Repository navigation
Conversation
Integrated loudness of ITU-R BS.1770-5 (K-weighting, 400 ms blocks with 75 % overlap, absolute and relative gates, channel weights of Table 3), momentary and short-term loudness of EBU Tech 3341, loudness range of EBU Tech 3342 and the true-peak level of BS.1770-5 Annex 2 with its 4-phase interpolating filter. The K-weighting is built from analog prototypes that give Tables 1 and 2 at 48 kHz and the same response at other rates. Tests synthesize the minimum requirement test signals of Tech 3341 (cases 1 to 6, 9, 12, 15 to 19) and Tech 3342 (cases 1 to 4) and check their expected responses and tolerances. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds the module
pytta.bs1770with the loudness measures used in broadcast and streaming:loudness(signalObj, weights=None): integrated loudness in LUFS of ITU-R BS.1770-5, with K-weighting, 400 ms blocks overlapping by 75 %, the absolute gate at -70 LUFS, the relative gate 10 LU below, and channel weights (Table 3; 1.41 for surround channels, 0 for LFE).momentary(signalObj)andshort_term(signalObj): the 400 ms and 3 s loudness of EBU Tech 3341, every 100 ms, with the time of the end of each window.loudness_range(signalObj): LRA of EBU Tech 3342, following its MATLAB reference code, including the percentile indexing.true_peak(signalObj): true-peak level in dBTP with the 4-phase, order-48 interpolating filter of BS.1770-5 Annex 2.The Recommendation gives the K-weighting coefficients at 48 kHz and asks for the same response at other rates.
k_weighting(fs)builds both biquads from analog prototypes (the parameters libebur128 also uses), which give Tables 1 and 2 at 48 kHz to 1e-10.The tests in
tests/test_bs1770.pysynthesize the minimum requirement test signals of the EBU documents and check their expected responses:The authentic programme cases and true-peak cases 20 to 23 are not included, since they need the EBU audio files or a 4 fs synthesis.
Checked with Python 3.12, numpy 1.26 and scipy 1.17. The existing tests behave as on
development: the 7 failures there (3 intest_h5io.py, 4 intest_pyttasave.py) are the same with and without this change.Sources: ITU-R BS.1770-5, EBU Tech 3341, EBU Tech 3342.
Co-Authored-By: Claude Fable 5.1 noreply@anthropic.com